#!/bin/sh

if [ "$1" = '' ]
then
	echo "Search term not given" >&2
else
	youtube-dl -j "ytsearch25:$*" 2>/dev/null | jq '[.title, .webpage_url] | join("")' -r | fzf -m -d"" --with-nth 1
fi
